home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2001 May / SGI IRIX 6.5 Applications 2001 May.iso / dev / java_dev.idb / usr / java / include / timezone_map.h.z / timezone_map.h
Encoding:
C/C++ Source or Header  |  2000-05-20  |  4.6 KB  |  90 lines

  1. /*
  2.  * @(#)timezone_map.h    1.3 99/01/22
  3.  *
  4.  * Copyright 1998, 1999 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. enum EHasDST { kAny, kDaylight, kStandard };
  16.  
  17. /* OS- and language-independent time zone lookup table.  This is used to
  18.  * determine the host time zone and set the user.timezone property.  This table
  19.  * relies only on the raw offset, presence or absence of DST, and the country
  20.  * code to determine the time zone.  Because it uses the country code, it can
  21.  * differentiate between some zones that are otherwise identical, such as
  22.  * Asia/Tokyo ("JST") and Asia/Seoul ("KST").
  23.  *
  24.  * Modified table derived from 1.2, with entries not present in 1.1 removed.
  25.  */
  26. static struct {
  27.     int          offset;
  28.     enum EHasDST hasDST;
  29.     char*        zone;
  30. } timezone_map[] = {
  31.     /* Offset - the offset, in minutes, from GMT, in the standard Java
  32.      * convention with zones to the east of Greenwich having positive
  33.      * offsets.  Note that this is the reverse of the Win32
  34.      * convention.  Entries are listed in order of offset.
  35.      *
  36.      * Country - the two-letter ISO 3166 country code.
  37.      *
  38.      * Daylight - indicates whether this is a Standard-only zone or
  39.      * whether an alternate Daylight zone may exist. The alternate
  40.      * zone may be historical! A setting of kAny indicates that we
  41.      * don't care.
  42.      *
  43.      * Zone - the name of the Java zone to be assigned for this
  44.      * offset, DST flag, and country. */
  45.  
  46.     /* Notes: This table was taken for JDK 1.2 and edited, partly by script and
  47.      * partly by hand.  The script removed those zones which are not supported
  48.      * by JDK 1.1.  I resolved duplicate entries which the script couldn't
  49.      * handle.  The result has no need for country entries, since nowhere in the
  50.      * table are zones differentiated by country.  Also, two new zones,
  51.      * previously missing from the 1.1 idMap lookup table, are added to this
  52.      * table (marked N).  The only 1.1 zone not accounted for here is
  53.      * Europe/Istanbul, which cannot be differentiated from Africa/Cairo, and in
  54.      * fact has a conflicting compatibilityMap/idMap name.  */
  55.     
  56.     /* Off. Ctry  Daylight    Zone */
  57.     { -660, /*WS,*/ kAny,      "MIT" /*Pacific/Apia*/              },
  58.     { -600, /*US,*/ kAny,      "HST" /*Pacific/Honolulu*/          },
  59.     { -540, /*US,*/ kAny,      "AST" /*America/Anchorage*/         },
  60.     { -480, /*US,*/ kAny,      "PST" /*America/Los_Angeles*/       },
  61.     { -420, /*US,*/ kDaylight, "MST" /*America/Denver*/            },
  62.     { -420, /*US,*/ kStandard, "PNT" /*America/Phoenix*/           }, /*N*/
  63.     { -360, /*US,*/ kAny,      "CST" /*America/Chicago*/           },
  64.     { -300, /*US,*/ kDaylight, "EST" /*America/New_York*/          },
  65.     { -300, /*US,*/ kStandard, "IET" /*America/Indianapolis*/      }, /*N*/
  66.     { -240, /*CA,*/ kAny,      "PRT" /*America/Halifax*/           },
  67.     { -210, /*CA,*/ kAny,      "CNT" /*America/St_Johns*/          },
  68.     { -180, /*BR,*/ kDaylight, "BET" /*America/Sao_Paulo*/         },
  69.     { -180, /*AR,*/ kStandard, "AGT" /*America/Buenos_Aires*/      },
  70.     {  -60, /*PT,*/ kAny,      "CAT" /*Atlantic/Azores*/           },
  71.     {    0, /*MA,*/ kAny,      "GMT" /*Africa/Casablanca*/         },
  72.     {   60, /*FR,*/ kAny,      "ECT" /*Europe/Paris*/              },
  73.     {  120, /*EG,*/ kAny,      "EET" /*Africa/Cairo*/              },
  74.     {  180, /*SA,*/ kAny,      "EAT" /*Asia/Riyadh*/               },
  75.     {  210, /*IR,*/ kAny,      "MET" /*Asia/Tehran*/               },
  76.     {  240, /*AM,*/ kAny,      "NET" /*Asia/Yerevan*/              },
  77.     {  300, /*PK,*/ kAny,      "PLT" /*Asia/Karachi*/              },
  78.     {  330, /*IN,*/ kAny,      "IST" /*Asia/Calcutta*/             },
  79.     {  360, /*BD,*/ kAny,      "BST" /*Asia/Dacca*/                },
  80.     {  420, /*TH,*/ kAny,      "VST" /*Asia/Bangkok*/              },
  81.     {  480, /*CN,*/ kAny,      "CTT" /*Asia/Shanghai*/             },
  82.     {  540, /*JP,*/ kAny,      "JST" /*Asia/Tokyo*/                },
  83.     {  570, /*AU,*/ kAny,      "ACT" /*Australia/Darwin*/          },
  84.     {  600, /*AU,*/ kAny,      "AET" /*Australia/Sydney*/          },
  85.     {  660, /*SB,*/ kAny,      "SST" /*Pacific/Guadalcanal*/       },
  86.     {  720, /*NZ,*/ kAny,      "NST" /*Pacific/Auckland*/          },
  87. };
  88.  
  89. #define timezone_map_length (sizeof(timezone_map) / sizeof(timezone_map[0]))
  90.